export const approvalMix = {
  created() {
    this.getQueryParams()
  },
  methods: {
    getQueryParams() {
      if (!this.$route || !this.$route.query) return
      if (this.$route.name === 'my-approval') {
        this.tabKey = this.$route.query.approvalType || 'unhandled'
        if (this.searchForm) {
          this.searchForm.taskCode = this.$route.query.taskCode || ''
          this.searchForm.wfTittle = this.$route.query.wfTittle || ''
        }
      }
      if (this.$route.query.modal === 'coverageStatisticsPage') {
        this.tabKey = this.$route.query.type || 'one'
        if (this.searchForm) {
          this.searchForm.id = this.$route.query.code || ''
        }
      }
      if (this.$route.query.modal === 'implementationPlanPage') {
        if (this.searchForm) {
          this.searchForm.taskCode = this.$route.query.code || ''
        }
      }
    }
  }
}
